<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_40) on Sun Feb 14 21:38:41 CET 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.gephi.preview.spi (gephi 0.9.1 API)</title>
<meta name="date" content="2016-02-14">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="org.gephi.preview.spi (gephi 0.9.1 API)";
        }
    }
    catch(err) {
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/gephi/preview/api/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../org/gephi/preview/types/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/gephi/preview/spi/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<a name="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;org.gephi.preview.spi</h1>
<div class="docSummary">
<div class="block">Interfaces for creating new renderers, item builders and render targets.</div>
</div>
<p>See:&nbsp;<a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/gephi/preview/spi/ItemBuilder.html" title="interface in org.gephi.preview.spi">ItemBuilder</a></td>
<td class="colLast">
<div class="block">Builds and returns new <a href="../../../../org/gephi/preview/api/Item.html" title="interface in org.gephi.preview.api"><code>Item</code></a> instances.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/gephi/preview/spi/MouseResponsiveRenderer.html" title="interface in org.gephi.preview.spi">MouseResponsiveRenderer</a></td>
<td class="colLast">
<div class="block"><b>Optionally</b> implement this interface in a <code>Renderer</code> that
 needs to be responsive to mouse events.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/gephi/preview/spi/PreviewMouseListener.html" title="interface in org.gephi.preview.spi">PreviewMouseListener</a></td>
<td class="colLast">
<div class="block">Listener for mouse events in Preview.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/gephi/preview/spi/PreviewUI.html" title="interface in org.gephi.preview.spi">PreviewUI</a></td>
<td class="colLast">
<div class="block">SPI interface to add UI settings components to the Preview.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/gephi/preview/spi/Renderer.html" title="interface in org.gephi.preview.spi">Renderer</a></td>
<td class="colLast">
<div class="block">Renderer describes how a particular <a href="../../../../org/gephi/preview/api/Item.html" title="interface in org.gephi.preview.api"><code>Item</code></a> object is rendered on a particular
 <a href="../../../../org/gephi/preview/api/RenderTarget.html" title="interface in org.gephi.preview.api"><code>RenderTarget</code></a> instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/gephi/preview/spi/RenderTargetBuilder.html" title="interface in org.gephi.preview.spi">RenderTargetBuilder</a></td>
<td class="colLast">
<div class="block">Builds and returns new <a href="../../../../org/gephi/preview/api/RenderTarget.html" title="interface in org.gephi.preview.api"><code>RenderTarget</code></a> instances.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!--   -->
</a>
<h2 title="Package org.gephi.preview.spi Description">Package org.gephi.preview.spi Description</h2>
<div class="block">Interfaces for creating new renderers, item builders and render targets.
        <h3>Create a new Item Builder</h3>
        <ol><li>Create a new module and set <code>Preview API</code>, 
                <code>Graph API</code>, <code>AttributesAPI</code> and 
                <code>Lookup</code> as dependencies.</li>
            <li>Create a new item class which implements <code>Item</code> or 
                extends <code>AbstractItem</code>. The <code>AbstractItem</code>
                class is located in the <code>PreviewPlugin</code> module so add
                it as dependency first. An item should be very simple but has a
                unique identifier returned by its <code>getType()</code> method.</li>
            <li>Create a new builder class that implements <code>ItemBuilder</code></li>
            <li>Implement the <code>getType()</code> method and returns the <b>same</b>
                identifier than the <code>Item</code> you created earlier.</li>
            <li>Implement the <code>getItems()</code> method by retrieving objects
                from the given graph.</li>
            <li>Add <b>@ServiceProvider</b> annotation to your builder, that it can
                be found by the system. Set <code>ItemBuilder</code> as the
                annotation parameter.</li>
        </ol>
        <h3>Create a new Renderer</h3>
        <ol><li>Create a new module and set <code>Preview API</code>, 
                <code>GraphAPI</code>, <code>Processing Wrapper</code>, 
                <code>iText Wrapper</code> and <code>Lookup</code> as dependencies.</li>
            <li>Create a new class that implements <code>Renderer</code>.</li>
            <li>Implement the renderer methods. </li>
            <li>Add <b>@ServiceProvider</b> annotation to your builder, that it can
                be found by the system. Set <code>Renderer</code> as the
                annotation parameter.</li>
        </ol>
        <h3>Add data to an existing item</h3>
        To add an additional data attribute to a Node or Edge item, you need to create
        a new item builder for the specific type. For instance if one want to add
        a new attribute to nodes create a new <code>ItemBuilder</code> for the
        type <code>Item.Node</code>. Simply return item objects with the data you
        want to add. The system will automatically merge your new data to node items.
        <h3>Extend or replace an existing renderer</h3>
        <p>To extend or completely replace a default Renderer by your own implementation, 
        create a new Renderer and set the annotation like below. In addition add Preview Plugin module as a dependency.
        </p><pre>@ServiceProvider(service=Renderer.class, position=XXX)
        public class MyRenderer extends NodeRenderer
        </pre>
        <p>Being XXX the new position of the renderer
        Then you can reuse parts of the base class or just override them.
        </p><p>Default renderers are:
        </p>
        <ul>
            <li> org.gephi.preview.plugin.renderers.NodeRenderer</li>
            <li> org.gephi.preview.plugin.renderers.EdgeRenderer</li>
            <li> org.gephi.preview.plugin.renderers.NodeLabelRenderer</li>
            <li> org.gephi.preview.plugin.renderers.EdgeLabelRenderer</li>
            <li> org.gephi.preview.plugin.renderers.ArrowRenderer</li>
        </ul>
        <h3>Add a new PreviewUI settings panel</h3>
        Plug-ins can add UI components to the Preview Settings module. Additional components are placed in new tabs and have access to the
        current <code>PreviewModel</code> and therefore <code>PreviewProperties</code>.
        <ol><li>Create a new module and set <code>Preview API</code> and 
                <code>Lookup</code> as dependencies.</li>
            <li>Create a new class that implements <code>PreviewUI</code> and implements
                methods.</li>
            <li>Add <b>@ServiceProvider</b> annotation to your builder, that it can
                be found by the system. Set <code>PreviewUI</code> as the
                'service' annotation parameter.</li>
        </ol></div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/gephi/preview/api/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../org/gephi/preview/types/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/gephi/preview/spi/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<a name="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2007&#x2013;2016 <a href="http://consortium.gephi.org">Gephi Consortium</a>. All rights reserved.</small></p>
</body>
</html>
